GtkRecentChooserMenu: avoid accessing a NULL action
authorTristan Van Berkom <tristanvb@openismus.com>
Sat, 6 Apr 2013 09:42:19 +0000 (18:42 +0900)
committerTristan Van Berkom <tristanvb@openismus.com>
Sat, 6 Apr 2013 09:46:20 +0000 (18:46 +0900)
When the GtkActivatable sets the related action, the activatable
properties are sync'ed. In this case the null check is important
to avoid updating from a NULL action.

gtk/gtkrecentchoosermenu.c

index 25dc025be4451ff44ba7f83f733c847e53b2dd60..64b3946a7f8ee36c60cabaa21d5c9c0f65d10e9f 100644 (file)
@@ -1202,6 +1202,9 @@ static void
 gtk_recent_chooser_sync_action_properties (GtkActivatable *activatable,
                                           GtkAction      *action)
 {
+  if (!action)
+    return;
+
   gtk_widget_set_sensitive (GTK_WIDGET (activatable), gtk_action_is_sensitive (action));
 
   _gtk_recent_chooser_sync_action_properties (activatable, action);